<?php
namespace app\admin\controller;
use app\admin\model\Siteinfo;
class Systemset extends Common
{
    function index(){
        if(request()->isAjax()){
            $site=new Siteinfo();
            if($site->allowField(true)->save($_POST,[id=>1])){
                return ["error"=>"success"];
            }else{
                return ["error"=>"更新失败"];
            }
        }else{
            $info=db("siteinfo")->find();
            return view('',["info"=>$info]);
        }
    }
}

?>